package com.zhaiweijia.eurekaconsumerfeign.service;

import com.zhaiweijia.dto.UserDto;
import com.zhaiweijia.vo.ResultEntity;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServiceHystrix implements FallbackFactory {
    @Override
    public Object create(Throwable throwable) {
        throwable.printStackTrace();
        return new UserService() {
            @Override
            public ResultEntity getUserList(UserDto userDto) {
                return ResultEntity.error("服务异常。。。。。。。");
            }
        };
    }

    /*@Override
    public ResultEntity getUserList(UserDto userDto) {
        return ResultEntity.error("服务器哪去了........................");
    }*/


}
